{extend name='index@Common/index' /} {block name='content'}
<div class="card">
  <div class="card-header  border-t pb-0" style="background-color: #fff">
    <!-- <p><small>查询财务状况或管理优惠券和发票。</small></p> -->
    <div class="tool-list d-flex">
      <ul class="list-inline mr-auto mb-0">
        <li class="list-inline-item">
          <a href="#" class="fs-16" style="color: #000"> 现金收支</a>
        </li>
      </ul>
      <!-- <ul class="list-inline m-0">
        <li class="list-inline-item p-2">
          <a href="#"><i class="iconfont iconguanlian1"></i> 操作指南</a>
        </li>
      </ul> -->
    </div>
  </div>
  <div class="card-body fs-12">
    <div class="cont-box">
      <div class="bg-f5 p-3 form-group">
        <ul class="list-inline mb-0">
          <li class="list-item">温馨提示：</li>
          <li class="list-item">收支明细按时间记录了账户流入和流出的交易流水，与账单的记账时间不同。所以同一时间范围内消费账单与消费类型收支可能存在差异。</li>
          <li class="list-item">例如：您有一笔100元的3月31日23：00到23:59的后付费账单，系统在4月1日0点后支付这笔账单。此时，您3月将有一笔100元账单记录，这笔账单对应的收支记录在4月。
          </li>
        </ul>
      </div>
      <!-- <div class="form-inline form-group">
                <div class="bg-f5 p-3">
                    <ul class="list-inline  mb-0">
                        <li class="list-item fs-18"><span class="color-green py-1 pr-1 pl-0">￥0.00</span>=<span class="color-green p-1">￥0.00</span>+<span class="color-green p-1">￥0.00</span></li>
                        <li class="list-item"><span class=" p-2">账号收入</span><span class="px-4">充值</span><span class="p-4">退款</span></li>
                    </ul>
                </div>
                <div class="bg-f5 p-3 m-lf">
                    <ul class="list-inline  mb-0">
                        <li class="list-item fs-18"><span class="fc-red p-1">￥0.00</span>=<span class="fc-red p-1">￥0.00</span>+<span class="fc-red p-1">￥0.00</span></li>
                        <li class="list-item"><span class="p-2">账号支出</span><span class="px-4">消费</span><span class="px-4">提现</span></li>
                    </ul>
                </div>
                <div class="bg-f5 p-3">
                    <ul class="list-inline  mb-0">
                        <li class="list-item fs-18">￥0.00</li>
                        <li class="list-item">第三方直接消费</li>
                    </ul>
                </div>
            </div> -->
      <div class="form-inline form-group">
        <ul class="list-inline mr-auto form-inline mb-0">
          <li class="list-inline-item form-inline">
            <div class="c-datepicker-date-editor J-datepicker-range-day mt10">
              <i class="c-datepicker-range__icon kxiconfont icon-clock"></i>
              <input placeholder="开始日期" name="starttime" class="c-datepicker-data-input only-date" autocomplete="off" value="{$_GET['start']}">
              <span class="c-datepicker-range-separator">-</span>
              <input placeholder="结束日期" name="endtime" class="c-datepicker-data-input only-date" autocomplete="off" value="{$_GET['end']}">
            </div>
          </li>
          <li class="list-inline-item">
            <select name="type" id="" class="form-control form-control-sm">
              <option {$_GET['type'] == '-1' ?'selected':''} value="-1">交易类型:全部</option>
              <option {$_GET['type'] == '0' ?'selected':''} value="0">消费</option>
              <option {$_GET['type'] == '1' ?'selected':''} value="1">充值</option>
              <option {$_GET['type'] == '2' ?'selected':''} value="2">退款</option>
              <option {$_GET['type'] == '3' ?'selected':''} value="3">提现</option>
              <option {$_GET['type'] == '4' ?'selected':''} value="4">产品交易</option>
            </select>
          </li>
          <li class="list-inline-item">
            <select name="channel" id="" class="form-control form-control-sm">
              <option {$_GET['channel'] == '-1' ?'selected':''} value="-1">渠道类型:全部</option>
              <option {$_GET['channel'] == '0' ?'selected':''} value="0">账户余额</option>
              <option {$_GET['channel'] == '1' ?'selected':''} value="1">第三方支付</option>
            </select>
          </li>
        </ul>
        <ul class="list-inline  m-0 form-inline">
          <li class="list-inline-item m-0"><button class="btn  btn-light btn-sm"><i
                class="iconfont iconicon_xiazai"></i></button></li>
        </ul>
      </div>
      <div class="ml-nge">
        <table class="table table-border">
          <thead class="bg-fB p-2">
            <tr class="font-weight-light">
              <th>编号</th>
              <th>时间</th>
              <th>产品</th>
              <th>交易类型</th>
              <th>金额</th>
              <th>渠道类型</th>
              <th>余额</th>
              <th>详情</th>
            </tr>
          </thead>
          <tbody>
            {if !empty($list[0])}
            {foreach $list as $k => $v}
            <tr>
              <td>{$v.order_number}</td>
              <td>{$v.create_time}</td>
              <td>{$v.productType}</td>
              <td>{$v.types}</td>
              <td class="{$v.type == '1'?'fc-green':'fc-red'}">{$v.type == '1'?'+':'-'}￥{$v.money|to_double} </td>
              <td>{$v.channel}</td>
              <td>￥{$v.balance|to_double}</td>
              <td>
                {if $v['type'] == '0' || $v['type'] == '4'}
                <a href="{:URL('index/Billing/dealrecorddetails',['order'=>$v['order_number']])}">查看账单</a>
                {else /}
                -
                {/if}
              </td>
            </tr>
            {/foreach}
            {else /}
            <tr>
              <td colspan="8" class="text-center">暂无数据</td>
            </tr>
            {/if}
          </tbody>
        </table>
      </div>
      <div class="d-flex justify-content-between pt-3 pl-3">
        <ul class="mr-auto"></ul>
        <div class="pagination mb-0">
          {$list->render()}
        </div>
      </div>
    </div>
  </div>
</div>
{/block} {block name='modal'} {/block} {block name='js'}
<script>
  $('[name="starttime"],[name="endtime"],[name="type"],[name="channel"]').change(function () {
    window.location.href = window.location.origin + window.location.pathname + '?start=' + $('[name="starttime"]')
      .val() + '&end=' + $('[name="endtime"]').val() + '&type=' + $('[name="type"]').val() + '&channel=' + $(
        '[name="channel"]').val()
  });
</script>
{/block}